home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 182_01 / bbscdef.h < prev    next >
Text File  |  1990-07-30  |  9KB  |  222 lines

  1. /*
  2.     bbscdef.h
  3.  
  4.     Global defines and storage definitions for use by
  5.     BBSc system.
  6.  
  7. Mike Kelly
  8.  
  9.     07/23/83 v1.1   Added #define of CLOCK, NOCLOCK, LCDAV, LCEMPTY.
  10.     07/05/83 v1.0   Added #define DEBUG to control compilation
  11.             of "if(debug)" code.
  12.     07/03/83 v1.0   Added stop_that (indicates a ctl-K or K received
  13.             deleted).
  14.             from the keyboard in portout routine).
  15.     06/28/83 v1.0   Added msg_delete (indicates if message is
  16.     06/25/83 v1.0   updated
  17.     05/17/83 v1.0   written
  18. */
  19. /*
  20. #define DEBUG     1
  21. */
  22. /* comment this out so the */
  23.                     /*  "if(debug)" code does NOT */
  24.                     /*  get compiled */
  25. #define DEBUG 0
  26.  
  27. /*
  28. #define CLOCK     1
  29. */
  30. /* if you have a clock board then */
  31.                     /*  this define wants to be  */
  32.                     /*  uncommented and NOCLOCK should */
  33.                     /*  be commented */
  34.  
  35. #define NOCLOCK   1
  36.             /* uncomment this if you do NOT have */
  37.                     /*  a clock board */
  38.  
  39. /* --------------------------------------------------------------------- */
  40. #include <stdio.h>
  41. #define MAXLINE 132
  42. /* MSDOS: may need to replace CPMEOF with some other symbol throughout */
  43. #define CPMEOF 0x1a
  44. #define TRUE      1
  45. #define FALSE     0
  46. #define ERROR    -1
  47. #define OK        1
  48. #define READ      0
  49. #define WRITE     1
  50. #define UPDATE    2
  51. #define STDIN     0
  52. #define STDOUT    1
  53. /* --------------------------------------------------------------------- */
  54.  
  55. #define CLEAR     'E'           /* clear screen on z-19 */
  56. #define ESC   0x1b
  57. #define CR    0x0d
  58. #define LF    0x0a
  59. #define BELL      0x07          /* Avon calling */
  60. #define CRLF      "\r\n"        /* <cr><lf> */
  61. #define CTL_D     0x04          /* <ctl-d> */
  62. #define CTL_K     0x0b          /* <ctl-k> */
  63. #define CTL_X     0x18          /* <ctl-x> */
  64.  
  65. #define BREAKCNT  5000          /* max count to allow for    */
  66.                     /*   status routines to loop */
  67. #define STATMAX   2000          /* used by stat debug routine */
  68.  
  69. #define WELCOME   "/z/welcome.bbs"  /* file name */
  70. #define BULLETINS "/z/bulletin.bbs" /* file name */
  71. #define NEWUSER   "/z/newuser.bbs"  /* file name */
  72. #define SYSTEM    "/z/system.bbs"   /* file name */
  73. #define CALLERS   "/z/callers.bbs"  /* file name */
  74. #define LASTCALL  "/z/lastcall.bbs" /* file name */
  75. #define USERS     "/z/users.bbs"    /* file name */
  76. #define HEADER    "/z/header.bbs"   /* file name */
  77. #define MESSAGES  "/z/messages.bbs" /* file name */
  78. #define HELP      "/z/help.bbs"     /* file name */
  79.  
  80. /*  defines used by the bbscfile.c routine     */
  81.  
  82. #define MSG1MAX 104     /* max. piece of message to put in 128 */
  83.                 /*  byte chunk of msg file */
  84. #define MSGSECT 128     /* size of message sector */
  85.  
  86. /*          end of defines used by the bbscfile.c routine */
  87.  
  88. /* global variables */
  89. #ifdef MAINMOD
  90. char    portin();       /* in routine returns a character */
  91. char    *gb4sin();      /* returns pointer to character */
  92.  
  93. FILE    *inbuf ;        /* handy input buffer pointer */
  94. FILE    *otbuf ;        /* another handy buffer pointer */
  95. FILE    *itbuf ;        /* pointer used to read/write user file */
  96.  
  97. char    w_fname[25];        /* first name on signon */
  98. char    w_lname[25];        /* last  name on signon */
  99. char    w_password[10];     /* password   on signon */
  100. char    *passptr;       /* ptr to password */
  101.  
  102.                 /* define user file fields */
  103. char    u_fname[25];
  104. char    u_lname[25];
  105. char    u_password[5];
  106. char    u_time1[12];        /* first time on system */
  107. char    u_date1[9];     /* first date on system */
  108. char    u_time2[12];        /* last  time on system */
  109. char    u_date2[9];     /* last  date on system */
  110. char    u_city[31];     /* city, state */
  111.  
  112.                 /* define message file fields   */
  113. char    msg_no[11];     /* message number */
  114. char    msg_date[9];        /* date of message */
  115. char    msg_time[15];       /* time of message */
  116. char    msg_to[21];     /* who message is to */
  117. char    msg_from[21];       /* who message is from */
  118. char    msg_pass[11];       /* password */
  119. char    msg_subject[21];    /* what it's all about */
  120. char    msg_text[842];      /* text of message 20 lines */
  121.                 /*  by 40 wide */
  122. char    msg_delete[2];      /* indicates msg status */
  123.                 /*  0 = active */
  124.                 /*  9 = deleted */
  125.  
  126.  
  127. int debug;          /* switch for debug mode */
  128. int offline;        /* switch for offline mode */
  129. int xpert;          /* switch */
  130. int active;         /* indicates if logged on */
  131. int statcnt;        /* count used for status routines */
  132. int stop_that;      /* switch - true indicates ctl-K */
  133.                 /*  or K received in portout routine */
  134.                 /* date/time fields - used by bbsclock.c */
  135. char    mm[3];
  136. char    dd[3];
  137. char    yy[3];
  138. char    month[20];      /* ie. January */
  139. char    day[3];         /* dd */
  140. char    year[5];        /* 19yy */
  141. char    date[30];       /* ie. January 31, 1983 */ 
  142. char    week[20];       /* day of week Monday, Tuesday... */
  143. char    ttime[12];      /* time of day  HH:MM:SS xM */
  144.                 /*          where x = A or P */
  145.  
  146. /*          variables used by the bbscfile.c routine */
  147.  
  148. char    h_next_msg[10];     /* next avail. message # */
  149. char    h_date[10];     /* last update date of header file */
  150. int h_next;         /* next avail. message # in integer */
  151.  
  152. /*          end of variables used by bbscfile.c */
  153.  
  154.             /* end of globals */
  155. #else
  156.  
  157. extern char    portin();       /* in routine returns a extern character */
  158. extern char    *gb4sin();      /* returns pointer to extern character */
  159.  
  160. extern FILE    *inbuf ;        /* handy input buffer pointer */
  161. extern FILE    *otbuf ;        /* another handy buffer pointer */
  162. extern FILE    *itbuf ;        /* poextern inter used to read/write user file */
  163.  
  164. extern char    w_fname[25];        /* first name on signon */
  165. extern char    w_lname[25];        /* last  name on signon */
  166. extern char    w_password[10];     /* password   on signon */
  167. extern char    *passptr;       /* ptr to password */
  168.  
  169.                 /* define user file fields */
  170. extern char    u_fname[25];
  171. extern char    u_lname[25];
  172. extern char    u_password[5];
  173. extern char    u_time1[12];        /* first time on system */
  174. extern char    u_date1[9];     /* first date on system */
  175. extern char    u_time2[12];        /* last  time on system */
  176. extern char    u_date2[9];     /* last  date on system */
  177. extern char    u_city[31];     /* city, state */
  178.  
  179.                 /* define message file fields   */
  180. extern char    msg_no[11];     /* message number */
  181. extern char    msg_date[9];        /* date of message */
  182. extern char    msg_time[15];       /* time of message */
  183. extern char    msg_to[21];     /* who message is to */
  184. extern char    msg_from[21];       /* who message is from */
  185. extern char    msg_pass[11];       /* password */
  186. extern char    msg_subject[21];    /* what it's all about */
  187. extern char    msg_text[842];      /* text of message 20 lines */
  188.                 /*  by 40 wide */
  189. extern char    msg_delete[2];      /* indicates msg status */
  190.                 /*  0 = active */
  191.                 /*  9 = deleted */
  192.  
  193.  
  194. extern int debug;          /* switch for debug mode */
  195. extern int offline;        /* switch for offline mode */
  196. extern int xpert;          /* switch */
  197. extern int active;         /* indicates if logged on */
  198. extern int statcnt;        /* count used for status routines */
  199. extern int stop_that;      /* switch - true indicates ctl-K */
  200.                 /*  or K received in portout routine */
  201.                 /* date/time fields - used by bbsclock.c */
  202. extern char    mm[3];
  203. extern char    dd[3];
  204. extern char    yy[3];
  205. extern char    month[20];      /* ie. January */
  206. extern char    day[3];         /* dd */
  207. extern char    year[5];        /* 19yy */
  208. extern char    date[30];       /* ie. January 31, 1983 */
  209. extern char    week[20];       /* day of week Monday, Tuesday... */
  210. extern char    ttime[12];      /* time of